package com.yanqu.road.server.cmd.disperseGold;
import com.yanqu.road.pb.cross.disperseGold.CrossDisperseGoldProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_DISPERSE_GOLD_SEND_RESULT, desc = "跨服返回送财结果")
public class CrossDisperseGoldResultCmd extends CrossCommand {

    private long serverId;
    CrossDisperseGoldProto.CrossDisperseGoldInfoMsg reqMsg;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = CrossDisperseGoldProto.CrossDisperseGoldInfoMsg.parseFrom(packet.getBytes());
        serverId = reqMsg.getServerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.S_CROSS_DISPERSEGOLD_RESULT, reqMsg);
        MessageHelper.sendPacket(serverId, 0, pbMsg);
    }

    @Override
    public void sendData() {

    }
}
